package tesys.objects;

/**
 * @author Group5 Comp3350
 *
 */
public class Iteration {
	private String name;
	private String summary;
	private String pid;//project id
	private String iid;
 
	
	public Iteration(String name, String mID, String pID, String iid)
	{
		this.name=name;
		this.pid=pID;
		this.iid=iid;
	}	
	public Iteration(String pid,String iid)
	{
		this.pid = pid;
		this.iid = iid;
	}		
	//create an introduction
	public void createSummary(String sum)
	{
		summary = sum;
	}

	//accessor
	public String getName(){return name;}
	public String getSummary(){return summary;}
	public String getPID(){return pid;}
	public String getIID(){return iid;}

	//compareTo()
	//to check if 2 objects are same
	public boolean compareTo(Object obj)
	{
		boolean result;
		Iteration t;
		
		result = false;
		
		if (obj instanceof Iteration)
		{
			t = (Iteration) obj;
			if (t.getIID().equalsIgnoreCase(iid) && t.getPID().equalsIgnoreCase(pid))
			{
				result = true;
			}
		}
		return result;
	}

	//toString()
	public String toString () 
	{
		return "Iteration: "+iid+" "+name+" ";
	}

}

